site_transient_{$transient}
Filter HookDescription
Filters the value of an existing site transient. The dynamic portion of the hook name, `$transient`, refers to the transient name.Hook Information
File Location |
wp-includes/option.php
View on GitHub
|
Hook Type | Filter |
Line Number | 2603 |
Hook Parameters
Type | Name | Description |
---|---|---|
mixed
|
$value
|
Value of site transient. |
string
|
$transient
|
Transient name. |
Usage Examples
Basic Usage
<?php
// Hook into site_transient_{$transient}
add_filter('site_transient_{$transient}', 'my_custom_filter', 10, 2);
function my_custom_filter($value, $transient) {
// Your custom filtering logic here
return $value;
}
Source Code Context
wp-includes/option.php:2603
- How this hook is used in WordPress core
<?php
2598 * @since 4.4.0 The `$transient` parameter was added.
2599 *
2600 * @param mixed $value Value of site transient.
2601 * @param string $transient Transient name.
2602 */
2603 return apply_filters( "site_transient_{$transient}", $value, $transient );
2604 }
2605
2606 /**
2607 * Sets/updates the value of a site transient.
2608 *
PHP Documentation
<?php
/**
* Filters the value of an existing site transient.
*
* The dynamic portion of the hook name, `$transient`, refers to the transient name.
*
* @since 2.9.0
* @since 4.4.0 The `$transient` parameter was added.
*
* @param mixed $value Value of site transient.
* @param string $transient Transient name.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-includes/option.php
Related Hooks
Related hooks will be displayed here in future updates.